const echartsStyle = {
  legend: {
    type: 'plain',
    orient: 'vertical',
    right: '0',
    bottom: '70',
  },
  grid: {
    left: '60',
    right: '110',
    containLabel: true,
  },
  yAxisObj: {
    nameLocation: 'end',
    nameGap: 20,
    nameTextStyle: {
      color: '#73819D',
      fontSize: 14,
    },
    axisTick: false,
    axisLine: {
      show: false,
    },
    axisLabel: {
      color: '#787F93',
      fontSize: 14,
    },
    splitLine: {
      lineStyle: {
        color: '#dadada',
      },
    },
    boundaryGap: false,
  },
  xAxisObj: {
    show: false,
    axisTick: false,
    axisLine: {
      lineStyle: {
        color: '#dadada',
      },
    },
    axisLabel: {
      color: '#787F93',
    },
  },
  seriesLineObj: function (color0, color1) {
    return {
      smooth: true,
      symbol: 'circle',
      symbolSize: 12,
      itemStyle: {
        color: '#4476F9',
        borderColor: '#fff',
        borderWidth: 3,
      },
      lineStyle: {
        width: 6,
        color: {
          type: 'linear',
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [
            {
              offset: 0,
              color: color0, // 0% 处的颜色
            },
            {
              offset: 1,
              color: color1, // 100% 处的颜色
            },
          ],
          global: false, // 缺省为 false
        },
      },
    }
  },
  seriesBarObj: function (echarts, color0, color1) {
    return {
      barCategoryGap: '40%',
      barMaxWidth: this.seriesBarObjbarMaxWidth,
      itemStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: color0 },
          { offset: 1, color: color1 },
        ]),
      },
    }
  },
  seriesBarObjbarMaxWidth: '50',
}

export default echartsStyle
